package com.example.myhotel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.myhotel.common.R;
import com.example.myhotel.entity.Rooms;
import com.example.myhotel.mapper.RoomsMapper;
import com.example.myhotel.service.RoomsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;


@Service
public class RoomsServiceImpl extends ServiceImpl<RoomsMapper, Rooms> implements RoomsService {

    @Autowired
    private RoomsService roomsService;


    @Override
    public boolean chekSame(Rooms rooms) {
        String address = rooms.getAddress();
        LambdaQueryWrapper<Rooms> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Rooms::getAddress,address);
        Rooms one = roomsService.getOne(wrapper);
        if (one !=null){
            return false;
        }
        return true;

    }
}
